//
//  HudTool.swift
//  IFXY
//
//  Created by LiuXing on 2017/1/4.
//  Copyright © 2017年 IFly. All rights reserved.
//

import UIKit
import SVProgressHUD

class HudTool: NSObject {
    
    public typealias HandleAction = (_ alert: UIAlertAction) -> Void
    
    
    static let shareInstance : HudTool = {
        let tools = HudTool()
        return tools
    }()
    
    func showEorrorMessage(errorMessage: String) {
        SVProgressHUD.setDefaultStyle(.light)
        SVProgressHUD.setDefaultAnimationType(.native)
        SVProgressHUD.showError(withStatus: errorMessage)
    }
    
    func showSccuessMessage(scuessMessage: String) {
        SVProgressHUD.setDefaultStyle(.light)
        SVProgressHUD.setDefaultAnimationType(.native)
        SVProgressHUD.showSuccess(withStatus: scuessMessage)
    }
    
    func show() {
        SVProgressHUD.setDefaultStyle(.light)
        SVProgressHUD.setDefaultAnimationType(.native)
        SVProgressHUD.show()
    }
    
    func dismiss() {
        SVProgressHUD.dismiss()
    }
    
}
